final String js = "javascript:(function () {
  var w = " + width + ";
  for( var i = 0; i < document.images.length; i++ ) {
    var img = document.images[i];
    if( img.width > w ) {
      img.height = Math.round( img.height * ( w/img.width ) );
      img.width = w;
      img.style.display='block';
    };
  }
})();";